package com.xianggu;

import com.xianggu.aop.AopMethod;
import com.xianggu.common.XiangGuService;
import com.xianggu.demo.dto.UserDto;
import com.xianggu.spring.annotation.AutoWired;
import com.xianggu.spring.annotation.Controller;
import com.xianggu.spring.annotation.GetMapping;
import com.xianggu.spring.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * @author chengjy
 * @date 2025/3/9
 */
@Controller
@RequestMapping("/xianggu")
//@AopClass
public class XiangGuController {
    @AutoWired
    private XiangGuService xiangGuService;

    @GetMapping("/test")
    @AopMethod
    public List<UserDto> test(String id) {
//        throw new RuntimeException("test");
//        return new ArrayList<>();
        return xiangGuService.queryUserList(id);
    }
    @AopMethod
    public String doService(String text) {
//        return text;
        return xiangGuService.doService(text);
    }
}
